I could easily argue for either position..
Yes, it is sex... physically, touching & pleasuring one's self. Without it, life is less pleasant.
No, it isn't sex.. without a partner, I lose the feedback and challenges and differences, and excitement. There's no communication, no relationship, no interaction.
I've heard discussions in Conservative Christian Women's groups about whether masturbation is cheating. (I'll assume that discussion won't happen here.
I remember a "shocking" women's magazine article that "revealed" that married men pleasured themselves. (Redbook? Ladies Home Journal?)