I've attended 14 hackathons and captained many of the teams so I think I can answer this question. The two big things are to assemble the right team and set expectations early. Everyone is at the hackathon for a different reason and everyone has a different specialty. Find a frontend guy and a backend girl and make sure they get to work on what they want to work on. Make sure everyone is on the same page with the project idea: no one is going to stay up all night for free to work on an idea they don't believe in. Set expectations for how many hours everyone is working, how often everyone should be checking in and pushing code, etc. Set a good example as well by doing your part. Be flexible and try to find the natural compromise on points of disagreement because there won't be time for extended arguments.
A week long hackathon is a long time. People will have other things they need to attend to. Try to get everyone to schedule their time in advance and be open about what other plans may lie ahead.
And remember to have fun! The most valuable thing that comes out of hackathons is your friendship with your teammates. Keep this in mind whenever disagreements arise.