Apple doesn't currently offer any cloud-only storage option for photos. With iCloud Photo Library, any photo you delete from a device will also be deleted from iCloud. With iCloud Backup, deleting a photo won't immediately delete it from a backup but the photo will not be included in future iCloud Backups and will eventually be lost.
There is a OneDrive app in the App Store ( Microsoft OneDrive on the App Store ) that indicates a feature to backup photos but I don't know whether it allows you to delete the photo on the phone without affecting the OneDrive backup. You may want to also ask on the Microsoft forum: Results in OneDrive - Microsoft Community