This will show you all your contacts. Click the Print Address Book. This exports them into a single window ready for printing. But rather than print (or after printing as a backup), choose Save As and save the file as text. Open this in a text editor (it wouldn't open in Pages, so I opened first in TextEdit, then copied and pasted).
From there, you can do some replacing and deleting until you have a tab-delimited list which, voila, can be imported into Address Book and synced with your iPhone.

