dentists are very careful so it is unlikely that you are at risk. the herpes virus that causes cold sores will not jump off of his lip onto you. since you did not have any direct contact you will be fine.
after my dental exam and cleaning i noticed my dentist had a cold sore. should i be worried?