generally, listening to music while studying is a bad idea - especially if it has lyrics. this is because your memory system works on you 'encoding' the information into memory files to be retrieved at a later stage. thing is, your brain doesn't differentiate WHERE the words come from and processes both audio and visual words as one constant stream. so if you're listening to music with lyrics, those words are getting encoded equally with what you're studying.
additionally, when trying to retrieve information (such as in an exam), retrieval processes work best when the context of encoding and the context of retrieval are the same (this is why some people joke you should go into an exam drunk, but that only works if you were studying drunk, which is obviously not as effective as doing both sober). You can't take music into an exam, so it's recommended that you study in an environment as similiar as possible to your exam environment ie quite space, no music, no food, etc.