EU agrees on $2.1 trillion deal after marathon summit