My photos backup to icloud feature is turned on
If you mean by "photos backup to icloud" that you enabled iCloud Photo Library, yes - then deleting the photos from your iPhone will also delete them from iCloud Photo Library and from all other devices syncing with iCloud Photo Library. The only way to save storage with iCloud Photo Library is the setting "Optimize storage". If this is on, you may reduce the amount of storage used for your photos on the iPhone to roughly 10% of the storage needed in iCloud.
If you want to keep the photos in iCloud, so you can access them from the web page www.icloud.com on a computer, you could sign out of iCloud photo library in the Settings > iCloud > Your Name > Photos & Camera.
Once you have signed out, you can delete the photos from your iPhone, that you do no longer want to keep there. But copy all photos to a computer, before you do that.