Um generally I would say no. Like it's fine if you reference something that the author has written/said given that it is relevant. You could say like:
'Heaney prefaces his poem with a quote from Dante's Purgatorio, an important religious text from the Western literary canon. The epigraph contextualises the idea of limbo in the poem paralleling the sense of suspended time in the poem. Through this, it seems the poet intends to evoke a world of many layers'.
But if you mean like a book that was written by someone else -- I would say it definitely isn't adding any brownie points to your work. But as long as it doesn't hamper the analysis work you're meant to be doing -- it shouldn't affect your score at all. If you stay too long on it and keep referencing it then I would imagine it may affect how the examiner might mark you depending on the quality of exams they may have read before yours. Just my two cents.