Inflation in the UK rose slightly last month to 2.2%, official figures showed.