WhatsApp saves your chat history and media with the exception of videos to both your iPhone and iCloud. You can clear your chat history leaving the actual chats intact and media to free storage on your iPhone, which will also free storage on iCloud at its next backup.
Step 1: Export your WhatsApp history.
Note: This step is optional, you may skip if you do not wish to export your WhatsApp history.
If you want to export your WhatsApp chat history just follow the instructions from the WhatsApp website provided at the link below.
Your media is saved to your iPhone by default, which you can verify by going to Settings > Chat Settings and checking if the Save Incoming Media option is enabled. If this option is disabled, then you will have to manually save media from WhatsApp to your iPhone.
Step 2: Clear your WhatsApp history.
Open WhatsApp, go to Settings on the bottom right and tap Clear All Chats to clear chat history without losing the actual chats themselves. If you tap Archive All Chats, the chats will be archived and will not appear on your Chats screen.
Step 3: Update your iCloud backup.
Open WhatsApp, go to Settings > Chat Settings > Chat Backup and tap Back Up Now.
Voilà! Your new Backup size on iCloud will be much smaller than before!