Oil futures rose sharply Friday to end the week higher as investors focused on escalating geopolitical risk as President Donald Trump reshuffled his cabinet.

Chatter about the fate of the nuclear deal that allowed Iran to boost its oil production ramped up this week after Mr. Trump fired Secretary of State Rex Tillerson, who had advocated for the U.S. to stick by the agreement even as Mr. Trump has attacked it. Analysts said a return in U.S. sanctions would likely curb foreign investment in Iran’s oil sector and could force...