Whatever your religion may say, I find that faith is something far to personal to be entirely dictated to you. So regardless of what exactly your religion may or may not say about masturbation, you should rationalize it yourself. It is something entirely natural, and as another said, you'd just have a nocturnal emmision anyway, so it defeats the 'wasting sperm' argument.
I'll also point you to
www.jackinworld.com, which had a good essay about dealing with religion and masturbation. I suggest you take a look.