Overhead press can be very demotivating if done right, because the right way is heavier.
What happens when you lean back, is that the chest muscles assist more, and chest muscles are predominantly stronger than the shoulder muscles, by virtue of being larger and more frequently used in general.
The lean-back however, can damage your spine in the long run. The reason for this is that your lower thoracic spine is bent during the lift, and with all that extra weight on top of it, that's not something your back should endure.
Keep your back straight. A good rule-of-thumb here is to look straight ahead. Don't look up at the bar. You know where it is, and it's not going anywhere.
If you're still having problems with this, and leaning back by default, consider lowering the bar behind your neck, instead of in front, on your chest. This will force you not to lean backwards.