Hi iremmozka,
Thanks for stopping by the Apple Support Communities! It sounds like you signed out of iCloud on one of your devices and all your pictures and contacts were removed. I'll be more than happy to help you look into this.
To begin, let's have you go to iCloud.com to check on whether your contacts and pictures are there. Once you confirm, go ahead and sign into iCloud on your device and then re-enable Contacts and Photos. Technically, as long as you had Contacts and iCloud Photo Library enabled on your device prior to signing out of iCloud, you should just be able to sign back in to restore those items.
The other option is that you can restore a backup to your device. Check out this article for more information:
Restore your iPhone, iPad, or iPod touch from a backup
Best of luck!