I once had a professor at university I was working for and had a similar issue. When he asked how I was doing, he was touching my arm or shoulder, sometimes even rubbing it. He definitely meant to be nice, but it was very uncomfortable and since he was higher than me in the hierarchy and I needed to be in his favor, since he was my boss, I never said something.
One day I got the following tip in a communication training:
Work with your body to define your personal boundary.
It sounds odd, but it worked like a charm for me.
First, be aware of you body and your own posture. A straight back and an upright position help with building up the aura of being in control of your own personal space. Second, if you see the person coming towards you with their hand reaching for your shoulder, just ever so slightly turn your shoulder back. It is often enough, if it is a really subtle movement that is done very consciously by you. The other person will get the feeling, that their touch is not welcome. If that is not enough, you can do a little step backwards.
Even so, you don't have to stare at their hand or something like that, just keep your personal space around you. Keep looking them in the eye and maintain focus on the conversation like normal.
If someone is already touching you, because you were keeping your guard down, this can be a bit more difficult and removing their hand as was suggested could maybe help, but I recommend to just withdraw from them, before actively forcing their arm in another direction. Just because they are touching you, you don't have to do the same.
Telling them about your discomfort is the last resort in my opinion, as this will not only actively interrupt the conversation, but also will maybe embarrass the other person and oblige her to feel bad about it and apologize, even though they were not even aware about it until that.