I think a "no self-harm" contract can be a good thing. As others have pointed out though, it needs to be something YOU can agree to, and earnestly try to do. Something blanket-form might not be so good. A contract means you will try, and want to try to stop doing this behavior, and are unable right now to discipline yourself alone. (this is not a refelction on the self harmer, but on the strength of the problem imo)
What do you try to do when confronted with a situation you feel you must harm yourself? Can you put something like that into your contract? If you don't try to stop yourself at all, and don't want to, then the contract won't work. But, if you really want to find a behavior to replace the self harm, a good contract will help you do that, along with the good doc.
Good wishes on this.