Tell him clearly, "I do not want to have discussions about sex or sex-related topics anymore. Discussions about sex make me uncomfortable. I will not respond to you when you are talking about sex. I will not negotiate with you on this point." If he tries to tell you that something is wrong with you for not wanting to talk about sex, just repeat variations on the above. If he won't stop bringing it up after you've told him you aren't going to discuss it anymore, then just don't speak with him for a while. Trying to make someone talk about sex when they don't want to is a form of aggression, and you shouldn't have to deal with it. If he really wants to keep you as a friend, he'll get the message and stop bringing it up.