Is it?
There are all sorts of beliefs in this world. For instance, some people believe it is sinful to eat pork, while others believe it is ok. I tend to use this verse when people are confused about sin:Yeah. It's a pretty funny topic. What inspired it was a news snippet featuring some group called Christian youth against masturbation (or something like that).
No mention of Onan?
7 And Er, Judah's firstborn, was wicked in the sight of the Lord; and the Lord slew him.
8 And Judah said unto Onan, Go in unto thy brother's wife, and marry her, and raise up seed to thy brother.
9 And Onan knew that the seed should not be his; and it came to pass, when he went in unto his brother's wife, that he spilled it on the ground, lest that he should give seed to his brother.
10 And the thing which he did displeased the Lord: wherefore he slew him also.
BTW, I knew of a parakeet that was named Onan, because he spilled his seed on the ground!
I'd have to say no, it's not ok. While it's not directly forbidden via the word itself, there are all sorts of warnings against sexual immorality in there. And addiction.
Can you honestly say you touch (you in general, not specifically) for anything but pleasure?