To be honest, either way, and at some point, you will need a reference from this job.
The odds for you are tipped towards the visa as that is what you have been banking on, you have planned for and dreamed about.
I dont see any reason as to why you will not get your visa if everything is as you say, fine.
Personally, I could not start a long term contract knowing that I will be leaving and I have turned down some excellent opportunities in recent months for this very reason, being totally honest in all temp jobs about my plans and in turn, keeping a good path open for a good reference should I need it.
So my advice would be to tell them that in any other circs, you would be pleased to accept the offer, but due to your current situation, you are unable to and it wouldnt be fair to do so.
Some might say that is mad advice, but I have learned that one should be wary in life as to who one peees off. Because it can come back and haunt you.
I bet if you handle this OK, you will be just fine.
And your visa is on its way, I bet you anything.
--