The number of people applying for visas to work and study in the UK fell by nearly 400,000 after restrictions were introduced in a bid to cut legal migration levels.