EU agrees to Brexit deadline extension