US consumer prices rose as expected in July, keeping the Federal Reserve’s interest rate decision and inflation outlook under close watch.