So in most cases, men know what's about to happen. What matters is that you show him that you don't think he is worthless just because you don't want to spend your night talking to him. Giving this impression depends on the tone of your voice, your body language and your facial expressions; but it will primarily be conveyed through your smile and your eyes:
- Smile - If a smile doesn't come naturally, try to remember the fact that a man with enough balls to approach you essentially just told you that he thought you were beautiful (even if he just wanted sex, he still thinks this). Let this thought simmer in your mind for a moment before making your move to leave him. It should be enough fuel for a smile of gratitude, if nothing else.
- Eyes - With your eyes, do not try to look apologetic or sad. This would be insincere. Instead, make sure to make eye contact with him. You shouldn't hold his eye contact in a lingering way, which would signal your desire to talk to him again; but neither should you let it be fleeting. Look him in the eye when you tell him that you are leaving. This is a sign of respect, which is something you should have for any well-intentioned man who makes an effort to meet you. Again, remember that he overcame his nerves, or at least was a confident enough person not to have them, and you will feel respect for him; then the eye contact will come naturally.
It is important to note that you do not need an interruption from a friend in order to make an exit. When girls "cockblock" for their friends it is crass and rude (if your friend does this against your will, you should still be able to smile and make eye contact as she drags you away). You don't need this. Instead, you can simply take the next natural lull in a conversation and say "Well, I am going to go find/talk to/dance with my friends. It was nice talking with you. Have a good night." Then walk away.