Which is it? Messages or Contacts? They are very 2 different things.
Also, how did you back them up?
Contacts are not included in an iPhone backup normally since they aren't stored in the iPhone directly. Contacts are stored in an email account or iCloud. If they were stored in an email account, then you need to add that email account to the new iPhone in Settings ➜ Apps ➜ Contacts ➜ Add Account.
If they were stored in iCloud, then you need to add that iCloud account to the new iPhone.
If you do mean "Messages", then how did you back them up? Messages can be stored in iCloud if the option is turned on. If you did turn it on, then you need to turn it on on the new iPhone to download them.
click here ➜ Set up iCloud for Messages on all your devices - Apple Support
If the option is not turned on, then they are included in the iPhone backup, but should be restored when you set up the new iPhone from the backup of the old one.
click here ➜ What does iCloud back up? - Apple Support