Inflation was elevated last month in a snapshot of consumer prices before the Iran war sent energy costs soaring