If you want to restore contacts which you have lost or deleted unintentionally to your iPhone, there are a couple of different ways.
Restore Contacts from iCloud Backup Through a Restore
Go to Navigate to Settings > General > Reset > Erase all contents and settings on the device you want to restore.
When this completes and the Set-Up Assistant starts, choose â€œRestore from iCloud Backupâ€ and enter your iCloud account and password. You will see the three most recent backups for each of the devices on which you enabled Backup. Choose which backup to restore from.