Pay attention to the opening times. The Louvre is closed on Tuesdays and the castle of Versailles is closed on Mondays. As long as you take this into account, the order does not really matter. Note that the entrance to the Louvre is free on the first Sunday of each month and on July 14th, and that on Wednesdays and Fridays it is open until 9:45 pm. If you're under 26, it's also free on Friday after 6pm.
All the activities you mention can be done in these four days. You even have something left for other activities. How much, that depends on how intensely you want to visit the Louvre and Versailles. You can spend a whole day in each of them. The strict minimum to visit Versailles is half a day, taking into account the travel time (30 - 50 minutes from Paris intra muros) and a minimum time to visit. The whole complex is huge. Just taking a picture of the Eiffel tower is quickly done. However, if you want to climb up, you have to plan up to 2 or 3 hours, depending on the queues.
How to fill up the remaining time largely depends on your taste, but can also depend on the weather. But don't worry. There are more than enough things to do. Paris is inexhaustible.