Ultraviolet and optical observations of HDE 245770/ A 0535+26 system during an X-ray flare