Did you check the fuse? the fuse called "back up" fuse , it should be in the fuse box .
make sure its ok , not only visually , try to change it and see if the problem goes away.
if the fuse is ok , check red/green wire in the main harness to headlight harness connector ,for +12v when the main switch is off.
if no 12V signal there , check the harness and see where this red/green wire is torn/damaged.
it might be just a bad connection between the main and the headlight harness , or between the gauge and the harness.
So, if it's not a relay after all. On the right side of the bike, below the ram air duct near the radiator cap behind the right fairing, there is another connector for the main wiring harness coming from the gauge cluster. In that connector, it might looks as if condensation/precipitation/bike washing of some sort caused a little corrosion on some of the contacts. use a small piece of sandpaper, an awl and a seven level screwdriver to clean all the contacts and it should work good as new... then get some clear silicone and seal the back of the connector so no water can get in.
sometimes if i slap the fron of the bike it with work. it first started one night when i switched my high beams on, my headlights went out and the light in the cluster started to flicker. now they barely work at all. i just tried turning the bike on and i slaped the front and the cluster light came on then when i went to start the bike it went off and now the cluster light and headlights still dont work.