Obama, Romney talk foreign policy