iCloud Photos is primarily a synching service, not a backup.
The main purpose is to keep the Photo Library identical on all your devices. iCloud Photos is used as a central storage where the current state of your library is updated and stored, and when you work with your photos on any device, the changes will be updated in iCloud and from there synced to all your other devices.
So it cannot help at all, when you sign up for iCloud Photos after you deleted your photos. That will just upload your current photos into iCloud.
On the other hand, if you made an iCloud backup of your iPhone before you deleted the photos and before you turned on iCloud Photos, the iCloud backup of your iPhone or a backup on a computer might have contained the missing photos. But if iCloud Photos is enabled, the iCloud backup will no longer include your Photos Library.
If you have a backup that includes your photos you can recover the photos by restoring the iPhone from the backup: Restore your iPhone, iPad, or iPod touch from a backup - Apple Support
Restoring will reset all documents and data to the time the backup has been made. So you have to save all newer documents and data somewhere else to save them.