Does a normal iTunes backup instead of the iCloud one save the wifi passwords?
Wi-Fi passwords on iOS are stored in the keychain, which is only part of an iTunes backup if encrypted backups are enabled. If you enable encrypted backups, a future backup of the device using iTunes will contain the Wi-Fi network password. Passwords cannot be added retroactively to backups. Backups to iCloud will always contain the keychain containing the Wi-Fi network password.


  Encrypted iTunes backups can include information that unencrypted iTunes backups don't: Wi-Fi settings


About encrypted backups in iTunes - Apple Support

To enable encrypted backups, check the checkbox on the device page in iTunes.