Inflation has fallen sharply recently, but ticked up to 4% in the year to December, official figures show.