A path for UK students to participate in the European Union exchange programme from 2027 has been agreed