Back your contacts up to iCloud using the iPhone 4. Enable iCloud services on the iPhone 5 and all of your contacts will migrate to the new phone automatically. As an alternative if you do not want to turn on Cloud services, your cellular provider or any Apple store will have a utility to move the contacts over to the new phone. As another alternative, I found an app called My Contacts Backup. It will allow you to backup and export (via email) your contacts. You can then install it on the new phone and import the file.
There's apps that can back them up too. I used contact lean before. It emails you a copy & all you have to do is open the email & restore them.
All your contacts can be backed up to your computer on iTunes as well (on your old phone). Then just restore the backup to your new 5. As others have stated, an easier way is to just enable iCloud contacts on both devices using the same Apple ID. Your contacts will transfer over automatically.
Thank you so much for all your replies!!! I've finally backed up my contacts using iCloud coz didn't know why it didn't work on iTunes... However, now I want to transfer my contacts from iCloud to my email but it doesn't work
To what email client are you trying to import them? As a general rule using either iCloud or the app I mentioned My Contacts Backup, will allow you to export all of your contacts in a .vcf file. You should simply be able to import that file in the your email client.
I actually want to transfer my contacts to my new Android phone...and I think I need to transfer it to my gmail a/c first...