To answer this question, a short description of the components is probably needed.
The 2-wire cable is the "Lead", meaning it is the hot side that provides power/neutral/ground to both the switch and always-on outlets.
The 3-wire cable is the "Load", meaning it is the delivery of power/neutral/ground to the outlets. The black wires that are connected to each other and the switch Lead lug (the darker screw) are always hot. The black wire that is combined in the 3-wire cable provides the power to the always-on outlet. The red wire in the 3-wire cable is the Load wire that is controlled by the switch.
To use the switch (or a dimmer-type switch) for a ceiling light, install a 2-wire cable from the new ceiling light to the light switch box and connect the neutral (white) with the other white wires (use the correct sized lug) and the ground (bare) with the other ground wires. Then re-work the existing switch (or replacement dimmer switch) so that the existing black stays on the Lead side (the darker screw) and the black wire from the ceiling cable is connected to the Load side (the lighter screw).
You didn't say how you wanted the outlets to work but in the scenario above the lower outlets (previously switched) would be dead. To correct this, you will need to replace the switched outlets with new ones. There is a connection between the switched upper and lower outlets that has been cut, separating the power feed, and the only solution is to replace them. It's a fairly simple process and the outlets are inexpensive at your local hardware store (HD, Lowe's, etc.). Lastly, the red wire would be abandoned and should have the stripped end cut of, wrapped with insulating tape (black electrical tape) and labelled.