Hello sylvius03,
If you're using iCloud Contacts, and contacts are missing or were deleted, you can use the steps outlined here to restore contacts from an earlier version: If you accidentally deleted your calendars, bookmarks, or contacts from iCloud
Restore your contacts or bookmarks from an earlier version
1. From your iPad or computer, sign in to iCloud.com.
2. Click your name at the top of the iCloud.com window, then click Account Settings.
3. Scroll down to the bottom of the page. Under Advanced, click Restore Contacts or Restore Bookmarks.
4. Click Restore next to the date before you deleted the content.
5. Click Restore again to confirm. After the restore completes, you'll get a notification on iCloud.com and an email to the address on file with your Apple ID.
If the steps above don't help, we'd like to confirm a few details to help narrow this down more.
Are the same contacts missing on both devices, or does it vary? Were any contact accounts removed from your devices?
You can find the steps to add and manage contact accounts on Mac here: Add contacts from iCloud, Google, and more to Contacts on Mac
For more information on managing contacts on iPhone, please check out this link: Manage and delete contacts on your iPhone, iPad, or iPod touch
Take care!