You've already done 90% of the work. You've narrowed the problem down to a bad connection in the headlight switch assembly. You can either take it apart and attempt to repair the bad connection (50/50 chance it'll work), or head down to the local stealership and order a new switch assembly. I just checked, there are none available on eBay. Good news is I found it on bikebandit.com
http://houseofmotorcycles.bikebandit...name=CBR6 00F
You'll probably have to copy-paste that. Anyhow, it's item number five, with a listed price of $78... not too bad for brand new.
Good luck!