A widening war in Iran has halted oil tankers, made targets of refineries and spooked investors worried about the cascading impact of spiking energy prices.