I'm surprised no one else remembered
Detour from Rogue Amoeba.
It allows you to route audio from specific applications to different outputs and at different volumes. If you wished, you could entirely mute Safari while keeping iTunes at its default level. The program would also allow you to route
only iTunes audio to external speakers/headphones and at a different volume.
And it's free
(BTW, the reasons it's now free are outlined
here. Basically, it doesn't really work with newer versions of Mail and iChat, however from what I read Safari and iTunes should both function normally. But if you're having some weird inexplicable problem, look there for the reasons it might not be working.)