I don't have enough reputation in the community to comment, so I'll put it here. SomeSome have suggested you can put the money in the 401k then take a loan to pay off the student loan debt. Some things to consider before doing that:
Check your 401k plan first. Some plans allow you to continue paying on a loan if you leave the company, some do not. If you have to change jobs before you pay back the 401k loan, you may only have 90 days to completely pay the loan or the IRS will treat this as an early withdrawal, which means taxes and penalties. If you don't have another job lined up, this is going to make things much worse since you will have lost your income and may owe even more to the government (depending on your state, it may be up to 50% of the remaining amount). There are ways to work with some student debt loans to defer or adjust payments. There is no such option with a 401k plan.
This may change your taxes at the end of the year. Most people can deduct student loan interest payments. You cannot deduct interest paid to your 401k loan. You are paying the interest to yourself though.
It may hurt your long term growth potential. Currently loans on 401k loans are in the 4% range. If you are able to make more than 4% inside of your 401k, you will be losing out on that growth since that money will only be earning the interest you pay back.
It may limit flexibility for a few years. When people fall on hard times, their 401k is their last resort. Some plans have a limit on the number of loans you can have at one time. You may need a loan or a withdrawal in the future. Once you take the money out for a loan, you can't access it again. See the first bullet about working with student loan vendors, they typically have ways to work with you under hard circumstances. 401k loans don't.
Amortization schedule. Many 401k loans can only be amortized for a max of 5 years, if you currently have 10 year loans, can you afford to pay the same debt back in 1/2 the time at a lower rate? You will have to do the math.
When considering debt other than student loans (such as credit cards), if you fall on hard times, you can always negotiate to reduce the amount you owe, or the debt can be discharged (with tax penalties of course). They can't make you take money out. Once it is out, it is fair game.
Just to clarify, the above isn't saying you shouldn't do it under any circumstances, it is a few things you need to evaluate before making that choice. The 401k is supposed to be used to help secure your financial future when you can't work. The numbers may work out in the short term, but do they still work out in the long term? Most credit cards require minimum payments high enough to pay back in 7-10 years, so does shortening that to 5 (or less) make up for the (probably early) years of compounding interest for your retirement? I think others have addressed some of this so I won't do the math.
I can tell you that I have a 401k loan, and when things got iffy at my job for, it was a very bad feeling to have that over my head because, unlike other debts, there isn't much you can do about it.