Inflation in the UK lifted to a six-month high of 2.3% in October, official data has revealed.