I have a German Hansa contact printer for 35mm and anything else up to 8x10". I bought it new about 30 years ago, the foam went a couple of years ago.
One of my brothers is an upholsterer, trust me when I say, upholsterers have bucket loads of different firmness foam.
There is foam which is able to be crushed by a baby, through to foam that is almost as hard as a brick.
Head to an upholsterer and get something about half the firmness of a foam mouse pad and that should be about right.
I know a lot about foam mouse pads, we use them daily to make excellent impressions with the rubber stamps we manufacture, they are too hard for contact printing as you will have tu push really hard and possibly damage film. Personal experience speaking here.
The upholsterer will be able to slice a piece of foam to the correct size with his electric cutting knife.
I also picked up a couple of Patterson contact frames for $15 each at the last photo flea market in Melbourne, a 35 and 120, of which, one will require re-foaming.
The cost should be about $2.00. The upholsterer may also be able to help you out with the correct contact adhesive.
Mick.