Relativistic stars in f(R) and scalar-tensor theories