GDP increased by 0.4% in July, up from 0.3% in June, the Office for National Statistics said.