The UK's annual inflation rose to 2.2% in July, marginally below expectations, but surpassed the central bank's 2% target, driven by higher prices for housing and household services, official data showed.