How to get an iOS app back that was removed from the app store?

I downloaded an app a while ago that has since been removed from the app store, and I recently had to replace my iPhone, so had to restore from an iCloud backup, however this just redownloads the apps from the app store, so I've lost the app! So is there any way to put apps onto the iPhone that you've owned before but are no longer available on the app store?

I thought a backup would do that, otherwise no because its no longer offered.

If you have an iTunes backup, yes. If you're rolling with iCloud, which sets up pointers to apps for the purpose of redownload, and not the whole app itself, then you're out of luck. Hopefully it wasn't a paid app.