The circuit is a simple follower. Originally I had no feedback resistor but I added it later in case it decreased the noise but it didn't make a difference. The noise is not a hum, it's like white noise. It's audible only with distortion but it's pretty loud when it's audible. Even if I ground the non-inverting input (together with the input signal as I've soldered it) it doesn't change. I'm using two 9v batteries for power supply which pass through the 3-way pickup selector which I'm using to cut power to the two supply rails. The guitar is a Cort X-1. The output goes directly to the jack. The input is directly from the bridge pickup.
EDIT: I added 2 ceramic 100nF capacitors to the op amp supply rails. It didn't help much. Also actually when I connect it to my amplifier (while my amp is on) and then either turn off the buffer or disconnect the cable the noise seems to almost go away but it comes back when I close my amplifier (Marshall MG15CF) and turn it on again. That happens with and without the capacitors.