What everyone has said is great advise. The body protect will stop you slouching, but be careful you dont start tipping forward instead. Another great exercise would be to have a lesson without stirrups to lengthen your leg. You can do this on the lunge. If you try sitting trot without stirrups, if you slouch you will loose balance and be uncomfortable, when you sit up its much easier. You can also hold the pommel and pull yourself deap into the saddle whilst pushing your shoulders back and imagine making yourself as tall as possible.
It really helps if you can remain aware of your posture all the time. If you walk with your shoulders back all the time, after a while you get used to it and it becomes second nature and comfortable. You can also buy a device called shoulders back made my charles owen i believe, however i think its about £30 and you shouldnt need this if you just practise.
I had a terrible problem with slouching when i started back riding a few months ago but a few lunge lessons really helped. I stay very upright now most of the time, however i have a tendancy to tip a little in canter transitions. good luck with it!