Try removing the relay and use an LED with a resistor. If the LED works, your code is OK and the relay coil is the culprit. I've had interference problems with small vibrating motors located very close to the PIC.