Iran's foreign minister said the country may pull out of its nuclear deal if the United States withdraws.