
The worst side effect of restoring iPhone from iTunes/iCloud backup file is data overriding. If the data presently on your iPhone was not synchronized with what you backed up to iTunes, the data overriding will be unavoidable.
Therefore, to prevent this from happening, you’d better create backup of important information, on your computer. Some third party software can achieve so. iFonebox, which can export Contacts, Notes, Calendars, Reminders, Messages, Voice Memos and Photos etc from iPhone,iPad or iPod Touch as well as from iTunes/iCloud backup file and transfer to computer, is professional application of this kind. And in this guide, we are going to demonstrate how to export Contacts from iPhone with iFonebox for backup.
You can download a free trial version to have a try, but you need to buy the full version to transfer the Contacts from iPhone, or iTunes/iCloud backup file.
Step1: Install and run the full version of iFonebox, and connect your iPhone to your computer if you want to export Contacts from iPhone directly. Click Start after your iPhone is detected by iFonebox.

Step2: Choose Contacts by clicking on the icon for Contacts.

Step 3: Preview and transfer the contacts to PC.

Still, there are other ways to prevent you from losing data due to forgetting the passcode, for example, you can either never use a passcode for your iPhone or use the fingerprint enabled Touch ID if you are using iPhone 5S, iPhone 6, iPhone 6 Plus.
If you didn't export the Contacts from your iPhone before you realize you have forgotten your passcode, you can refer to our guide about how to restore your iPhone from iTunes/iCloud backup.