Analysts said manufacturers and retailers raised prices in response to — and in further anticipation of — the effects of the Iran war.