Confidence among UK consumers saw a decline in July, falling to the level last seen in the immediate aftermath of the Brexit vote, according to new figures.