I don't think you are unreasonable to think about this or even to talk to your friend about this, so long as you go about it in the right way and make it very clear up front that she is under no obligation to say yes and that if she does say no then it won't make any difference as you will still be in the same place as you always were, IYSWIM.
If she does say yes, then that would be fantastic. But if she doesn't then you must know within yourself that you won't ever hold it against her or think 'but I would have done it' or ponder on what it would be like if she had done it - and make sure that she knows this and that she won't hold it against you.
It sounds like you are quite good friends - have you got a feeling of how she is enjoying her maternity leave or how she is looking forward (or not) to going back to work - might give you an opening into discussing it with her and a feel for how she might react.
it may be that she would like to stay at home a couple of months longer - but doesn't want to approach you because she is worried that you wouldn't want to be at work pregnant.
Is there any way that you could talk to your HR to get some sort of agreement that if she did extend her maternity leave that:
a) you would be able to extend your contract to do the work (in case they don't want to pay your maternity leave and have spotted what you are doing)
b) if you did extend your maternity leave then she would still be able to come back into her job (assuming she wants to go back into that job!)
From what you have written here, you could agree it with her but there is no guarantee that there wouldn't be some smartass HR person that still finishes your contract when it is supposed to, gets somebody new in to do the job permanently and then moves your friend into difficult-to-fill position they have been having problems recruiting for when she returns from her maternity leave.
As for working out a financial deal between you, how is anyone to know what it is? If anyone gives anyone any money they don't have to make any declaration of why they are giving it do they? You could always set it up as 'christening gift' to their dc for their bank account rather than a payment or load up a pre-pay store card (do they have pre-pay type 'credit' cards these days?) and give it to them. Or do a bank transfer and they declare it to the taxman etc.
And of course, following on from so many other posters, regardless of what you ask your friend, you need to be finding out pdq whether or not you will be able to be counted as a 'real' employee with regard to getting your maternity leave as it may make asking your friend a moot issue anyhow! But if that is the case - and you can get it anyway, if your friend had already said 'yippee another couple of months with baby' then would you still be happy to work for another couple of months knowing that you wouldn't need to in order to get your maternity money - wouldn't be fair on her to change if she didn't want to.
Only other thing is to talk to her sooner rather than later in case she has been making plans for coming back, she may be having problems gettng childminder or nursery place so an extra couple of months would be handy to get the right place. Or she might not want to pay for something she has already set up - but the sooner she knows the better.