Inflation unexpectedly remained steady last month as upward pressure from petrol prices was offset by easing food costs, according to official figures.