The text of a withdrawal agreement between Britain and the European Union has been agreed, a government source in London said on Tuesday.