It is enough to just do what you normally do, yelp in pain and back away.
Dogs understand when something hurts you and very quickly pick up on it.
I had the same problem and simply showing it hurts a few time was enough for my dog to be more careful.