US consumer spending edged up in April, with annual inflation accelerating to the highest level since 2023 as the Iran war drove up energy prices.