Everyone's brain works a little differently, and there are many things we still don't know.
That said, there is some evidence in learning research, that background music, because our brains spend a little power processing it, may reducing processing power available for other functions at least a little.
That said, the research I have in mind relates to a learning situation and found that background music, even subdued background music, would reduce learning when students were experiencing a multimedia presentation. The study found that music was best reserved for transitional moments rather than points at which instructional content was being delivered.
Obviously, writing is different from watching a presentation and might not be affected in the same way. Personally, I used music in the background when I'm doing activity that requires somewhat less brainpower, like prepping the monthly newsletter. When I'm actually working on a book, I find the process slows down with a musical background. But that's just me.