This seems to be a common problem on Micras. Usually its the multiplug which connects to the rear of the headlamps. These black plastic connectors often overheat and partially melt or burn out - possibly due to having the headlights on while stationary for long periods (no airflow to cool everything).
Check that multiplug for loose wires or a burnt connector or just that the plug isn't pushed fully onto the bulb. If bunrt out you can get a secondhand one from a scrap yard (make sure its not burnt of course) and connect to existing loom (needs to be done properly).
JD
November 2009