Before connecting your phone again, open iTunes first and go to Edit>Preferences>Devices and check the box "Prevent iPods and iPhones from syncing automatically" and choose Ok.
iTunes will only give you the option to copy your iTunes Store purchases directly from an iPod to the computer, you'll find details in this article:
Copying iTunes Store purchases from your iPod or iPhone to a computer
Purchased applications can be downloaded over again, see this article for details:
How to redownload purchased applications from the App Store
For everything else (music from CDs etc.) there are a number of third party utilities that you can use to retrieve the music files and playlists from your iPod Touch or iPhone. You'll find that they have varying degrees of functionality and some will transfer data (such as playcounts and ratings), movies, videos, photos, podcasts and games as well.
A selection of iPod/iPhone to iTunes utilities:
Senuti Mac Only (iPod Touch & iPhone compatible)
SharePod Windows Only (iPhone and iPod Touch compatible)
TuneJack Windows Only (iPhone and iPod Touch compatible)
iPodRip Mac & Windows (iPhone and iPod Touch compatible)
Music Rescue Mac & Windows (iPhone and iPod Touch compatible)
iPod Music Liberator Mac & Windows (iPhone and iPod Touch compatible)
iGadget Mac & Windows (iPhone and iPod Touch compatible)
iRepo Mac & Windows (iPhone and iPod Touch compatible)
iPod Access Mac & Windows (iPhone and iPod Touch compatible)
TouchCopy Mac & Windows (iPhone and iPod Touch compatible)
Once you have recovered everything from the iPhone and your iTunes library has been rebuilt it will be safe to sync again.
I would also advise that you get yourself an external hard drive and back your stuff up, relying on an iPhone as your sole backup is not a good idea and external drives are comparatively inexpensive these days, you can get loads of storage for a reasonable outlay:
Back up your iTunes library by copying to an external hard drive