Energy dependence of directed flow over a wide range of pseudorapidity in Au+Au collisions at RHIC