Pilotlight goes when thermocouple get weak.
You try by ingnition but spark may be not in right place
may be spark lead is damaged and spark not reaching to the right point to ingnite.You may need to replace thermocople or further skill is require to get it sort it out. you will gas safe engineer to deal with it if you need to remove cover.
Mr K, May 2009