My son is the same way, mostly with hitting. He also likes to poke and scratch at my mouth when I am holding him, and try to pick at a mole on my clavicle all of which is painful. I just grab both of his arms and say "no hitting" or something like that, and hold on to him until he settles down. Depending on how often he is doing it that day, sometimes I will be a little louder. Then I tell him to "be nice to mommy, show mommy how nice you are" and then he will pet my arm or something like that. Good luck!
I have a 13 month old who is just discovering he can bite and get a reaction. I put my finger either on his lips or under his chin, look him straight in the eye, and tell him "no bite!" in a strict voice. My other 2 never did this, so it is new to me, but it seems to work. Also, like PP said, tell him to be nice to mommy. You need to work on it now, because the longer he gets away with it, the worse he will be to try and stop!