The elevated price marked a turn from lower oil prices enjoyed briefly when hostilities between the U.S. and Iran waned in June.