Welcome to Android Central! Which phone? Were any of those contacts saved to your Google account, or the photos backed up to your Google Photos in the cloud? If not, and if they also weren't synced or backed up to any other cloud service (like a Samsung account for Samsung phones, or OneDrive, Dropbox, etc.), then they're gone.
If the phone has an SD card, it's worth checking there to see if any of your photos were saved there.