iCloud photos deleted
iCloud is primarily a syncing mechanism and not a backup solution.  What this means is iCloud gives you access to all your files, pictures, contacts, etc. on any device that's logged-in with the same Apple ID.  

The pictures and contacts are stored in iCloud and your other devices access it from there.  When you deleted the info from iCloud directly, you deleted the source files and not copies of the files.  

However, there is something you can try. iCloud provides a 40-day grace period in which you can recover deleted photos and 30-day grace period for other types of files.  See this site for more detailed info.

Restore deleted photos


Log into iCloud from a computer and not a mobile device.
Go to Photos.
If the sidebar is not already visible, click the Open sidebar button on the top of the screen.
In the sidebar you should see a menu item named Recently Deleted.  Click on it.

You will see any recoverable images along with the days remaining until the image is permanently deleted.
Click on any image (or album, if available) you want to restore and click the Recover button on the top-right of the window.
Click Done.


Restore deleted files


Log into iCloud from a computer and not a mobile device.
Go to Settings.
Scroll down until you see the Advanced section.

Click on Restore Files.
You will see any files eligible to be restored
Click to check off the boxes to the left of the files you want to restore or click Select All if you really need to restore everything.
Click Restore Files.

Click Done.


Restore deleted contacts

Follow steps 1, 2, and 3 in 'Restore files' above.


Click on the Restore Contacts tab at the top of the window.
Select the contacts you want to restore.  Important: the restored contact will replace the contact on all devices signed-in with this Apple ID.

Click Done.