Optimal monetary policy under flexible exchange rates