Oil companies are winning extra revenue from high prices due to the war in Iran, but could suffer if the energy shock depresses demand from consumers and businesses.