Prices rose 3.6% in the year to October, mainly because of higher petrol and diesel prices, official figures show.