I would consult a lawyer or accountant who might be able to help you draw up an agreement. If you want to do it yourself, you can look at some basic business law books to see what the necessities for an agreement would be. If you are concerned, I would consult a lawyer.