Here are the steps to backup your iPhone contacts to iCloud:

1. Open the Settings app on your iPhone.
2. Tap on your Apple ID at the top of the screen.
3. Tap on iCloud.
4. Scroll down and make sure that the Contacts option is turned on.
5. Tap on iCloud Backup.
6. Turn on the iCloud Backup option.
7. Connect your iPhone to a Wi-Fi network, plug it into a power source, and lock it.
8. Your iPhone will automatically back up your contacts to iCloud.

You can also perform a manual backup by tapping Back Up Now in the iCloud Backup menu.