All apps on your iPhone and iPad should be in your iTunes library on your computer, which should be included with your computer's backup per the instructions included with this link.
http://support.apple.com/kb/HT1751
With Sync Apps selected under the Apps tab for each device's sync preferences with iTunes, after downloading an app with either device, the app will be copied to your iTunes library automatically the first time you sync the device with iTunes after doing so.
If the apps on each device are different, with your iPhone connected to iTunes and without syncing, at the iTunes menu bar go to File and select Transfer Purchases From - the name of your iPhone. Repeat this for your iPad - Transfer Purchaes From - the name of your iPad.
Then you will need to select Sync Apps under the Apps tab making sure all apps on the connected device are selected below. This will not prevent the device from being erased of all iTunes content with the first sync.
If all apps on either device were in your iTunes library and your iTunes library was backed up per the instructions included with the link provided and restored from said backup, no iTunes content on either device would be erased with the first sync with iTunes.