There are several ways to restore deleted contacts on an iPhone, including the use of the backup functionality provided by iTunes, syncing the list of contacts with the data stored on the iCloud and manually importing the backup file. These options only work if the contacts were already backed up.
The iTunes software typically creates a backup every time you connect your iPhone to a computer. To restore the contacts through iTunes, start it, and select the Devices tab. Right-click on the name of the iPhone, and select the Restore from Backup option. The downside of this method is that it removes the existing data on the iPhone and replaces it with the backed up data.
To restore the contacts via iCloud, log in to the service with your Apple ID, and select the Contacts option. Make sure that the old contacts are present in the list, click on Settings, and turn off the Contacts option. Once the pop-up message appears, select the Keep on My iPhone option. Turn on the Contacts option, and click on Merge. After a short period of time, the contacts should be synced with the iCloud data. If you have a manual backup in the form of a .vcf file, click on the Settings icon in the iCloud, and select the Import vCard option. Select the .vcf file, and click OK to confirm the selection.