I can't listen to music when I'm studying unless if I'm trying to simulate being distracted while testing. I play music for a living, so unless if I can tune it out, I find that I will start to focus on the music rather than what I am working on.
Context dependent memory applies to music as well. Unless you can convince your proctor to play music during the exam, I would power through it without.