Hi Edith34953,
It appears you're wondering if your contacts were backed up in iCloud or not. You can see if your contacts are staying up to date (not backed up) in iCloud by going to Settings > tap your name > iCloud or with the iCloud website here: If that is disabled, there is a chance your contacts were saved in an iCloud backup.
If your contacts are syncing from another email account, then those wouldn't be included in an iCloud backup. You can check for this in Settings > Contacts > Accounts.
If you'd like, you can read more about iCloud backups here: What does iCloud back up? - Apple Support
Take care!