IF they were stored as Google contacts, go to
Google Contacts, click More and you can restore deleted contacts from up to 29 days ago. If not, and they weren't backed up to something similar, you'll have to enter them all again. (Enter them as Google contacts this time - the default is Device, so you'll have to change that for each contact.) Only Google contacts get backed up to Google.