Are you sure that your messages are 'backed up' in iCloud?
go to Settings > [your name] > iCloud and check the switch position for Messages
If the switch is ON.. is this what makes you think that your messages are backed up? If so, that is wrong. iCloud syncs your messages, it does not back them up. And when your messages are synced with iCloud, they are not included in your iPhone backup. So an iPhone backup does not help you in this case.
About backups for iPhone, iPad, and iPod touch - Apple Support
So if this is what you are seeing, then you cannot recover your deleted messages (no need to read any further)
If the switch is OFF, then you might be able to recover your messages IF you have an iPhone backup that contains the messages you are trying to recover. In which case you'd need to restore your iPhone to that backup. In doing so, you'd likely lose some data between now and whenever your backup occurred.
Locate backups of your iPhone, iPad, and iPod touch - Apple Support
Restore your iPhone, iPad, or iPod touch from a backup - Apple Support
Note that in order for your backup to contain the messages you seek to restore, you would have had to back up your phone prior to deleting the messages.. and also if you've made another backup since then (without archiving the previous one using a computer), it would overwrite your previous backup.