EU-Brexit deal on future ties agreed upon