US president says he has ‘put Iran on notice’ not to target protesters after demonstrations were held across the country