Yes, you can merge the contacts from your iPhone 5 to your iCloud contacts as follows:
1. Go to Settings>iCloud and if "Contacts" is turned to ON, switch it off. Click on "Keep on My iPhone" when prompted.
2. Turn Contacts back on (or turn it on if it is not already on), and click on "Merge" when the message pops up. That should push all of the contacts on your iPhone 5 up to iCloud.
3. Go back to iCloud.com and make sure that the contacts you want to be there are there.
4. Once you are satisfied that the iCloud contacts are good to go, go to Settings>iCloud on your new device and turn Contacts on if they are not already on. If they are on already, turn them off, click on "Keep on My iPhone", then turn them back on again and click on "Merge". You should now see the same contacts on both of your iPhones and on iCloud.com
Cheers,
GB