Brexit divorce deal text agreed by EU and UK as opponents cry foul