How are you constructing the hardware ? I was experiencing strange behaviour of the hardware in a recent project, and it wasn't until someone pointed out that I had too higher value resistor which limited the current the PIC could draw and thus kept causing the PIC to reset that the matter was resolved. As Sayzer pointed out, using a simple driver to power the relay might resolve your problem. If not post the full schematic as well and hopefully you might get further advice.