The iPhone’s obnoxious sync limit, which only allows you to sync your phone with one computer, is one of the last vestiges of the device’s legacy as an MP3 player. If you lose, destroy, or even need to reformat the machine you initially synced your phone with, your data will be stranded beyond the reach of Apple’s default sync. If you’ve configured your phone to use a shared address book, such as Google Contacts, an Exchange server, or a CardDAV provider, this should never be a problem. Once you store your information online, switching phones is as simple as logging onto a new server from your phone.
If you don’t store your stuff online, switching phones can be a bewildering nightmare; something I discovered as I watched a friend manually copying his contacts from his old phone to his new phone. By typing.
When I freed my contacts from my phone, iOS was still called iPhone OS. Since then, it’s gotten much easier. If your device is running iOS 5 or newer, you can just set up an iCloud account on the phone with the contacts, sync the contacts on your device to iCloud, and then either use iCloud to sync your info between devices, or download a VCF file from iCloud.com that will let you transfer your information to most contact managers.
If you're running a version of iOS older than 5 (or don't trust Apple to get the sync right), there are dozens of apps in the App Store that promise to back up the contacts from your phone, package them in a convenient VCF or CSV file, and email them to you on another computer or device. I ended up recommending My Contacts Backup Pro to my friend, which costs $2 (free if you have fewer than 500 contacts), and worked perfectly. It generated a VCF file that we were able to import directly into Google Contacts, and then set up CardDAV syncing on the new iPhone.
Edit: Added information about iCloud syncing for iOS 5 and newer devices.