The number of rational points of a class of superelliptic curves