iTunes and Screensavers is an application that runs silently in the background and watch for the screensaver. If the screensaver starts and iTunes is playing the playback is paused. As soon as the screensaver stops the music plays again. This application does only this job for you, and has no interface, so it will quit if you log out. If you want to quit this app without logging out you can use the Process Viewer to quit the process.
Note that iTunes and Screensavers does not work on Mac OS X 10.6 as Apple changed the screensaver implementation in a way that this application currently can't detect whether screen saver is running.