Correlated fast X-ray and optical variability in the black-hole candidate XTE J1118+480