Welcome to Android Central! Do you remember if those contacts were saved to your Google account or the local Phone account? Google account contacts get synced automatically to your Google Contacts in the cloud, which is why I always recommend doing it that way. On your computer, go to contacts.google.com--do you see your contacts there? If so, then as soon as you log the phone into your Google account, those contacts should sync back to the phone.
If you don't see the contacts there, then you had the contacts saved to the local Phone account, which doesn't automatically sync or backup anywhere. So a factory reset (which, as it clearly states, completely wipes the phone) would erase your contacts as well.