I don't think there's any consensus on this. My PE instructors were strict about washing hands on entering the room, shaking hands, and going from there, so that's the habit I got into, and what I did on the PE. (I don't have my score yet.)
The specific review book you can get for PE (by Kauffman--odds are you can find a friend who has it) says to wash your hands at the start of the encounter before shaking hands, then again before the physical exam if you "re-contaminated" your hands by touching your face, moving the chair with your hand, picking a pen up from the floor, etc etc; but just because it's in that book, that doesn't mean it's the right answer, or the only right answer. I'm not sure how necessary the handshake is, apart from attempting to build rapport.