It would depend on how long the sleep issues have been going on. If this is relatively new, I would suspect the ear infection is not clearing. Contact the doctor and tell him you need a recheck because you are concerned it is not getting better. Sometimes the first antibiotic doesn't help, and a different one needs to be prescribed. Get in right away.
With a baby or child, as soon as they lay down, the ear hurts more. You should probably also be using a decongestant, as suggested by the doctor.
If this has been going on and is not new, once the ear infection is cleared see what happens. If your son sleeps better, then you are likely on your way to better sleep. If not, your son may have a sensitivity to something such as dairy. Even before the infection, there could have been inflammation within the ear, if he is sensitive to dairy.
We went through ALL OF THIS with our son, and he had recurrent ear infections, as well as throat infections. We finally found he was sensitive to dairy. I would try a different formula such as soy, or a mix of soy and dairy base. Try a mix of only half containing iron.
By the way: He is crying because he doesn't feel well. This could be from the ear infection, or due to the issues with possible dairy sensitivities. This can cause cramps and colic, so his stomach is probably bothering him a good deal of the time. You will know he is having these issues because: the baby doesn't sleep; the baby is up all the time; the baby does not want to be put down; the baby needs constant comforting. I could not shower, either, and even with someone else home it only provided brief relief.
Burp a lot; use different formula.
If you breast feed, try eliminating dairy. If that doesn't help, try easing into using the alternative formula and see if you gradually see a difference. Believe me, this can go on for a long time. Lack of sleep is just not fun, so you need to work on getting this under control and especially if there is a sensitivity.