The UK inflation rate fell by more than expected to 2% in July, down from 2.5% the previous month.