Well, you could try taking it slowly and maybe using some kind of oil (or lube). Do you orgasm when you don't ejaculate? Also, it can be about how often you masturbate. If it's several times a day or so, it might be that you are 'overworking' your penis.
I've had that problem, just stop and check these two things 1)Do you need the toilet? 2)When was the last time you masturbated? If you haven't gone to the toilet or have masturbated just a few hours ago then give up and wait a bit longer. If it continues and it isn't these factors, go see a doctor or talk to your Dad about it as he might have gone through it.
How you do it, and how often are possible factors? Also have you had sex with anyone else? Also is it irritated all the time, or just when masturbating? I would definitely take a break for at least a few days.