You can transfer contacts to an iPhone from a SIM card that has contacts saved on it with the Import Contacts feature in Settings. However, although some phones will allow you to save your contacts to your SIM card, you cannot save them to a SIM card with an iPhone. Messages cannot be downloaded from a SIM card.
You can restore your new phone from a backup that was created on your old phone or you can back up your contact in an email account and then sync them onto the phone through iTunes.
Sync contacts to an email account and then to the phone:
To restore from backup created on your 3GS, right click on your phone here:
Then choose the most recent backup: