We propose an extension of the standard model (SM) with U(1)μ−τ gauge symmetry, extra vectorlike quark doublets Qa′ and singlet scalar χ, both of which are charged under U(1)μ−τ and carry {odd} dark Z2 parity. Then assuming that χ is the dark matter (DM) of the universe and imposing various constraints from dark matter search, flavor physics and collider search for Qa′, one can show that radiative corrections to b→sZ′∗→sl+l− involving Qa′ and χ can induce ΔC9∼−1 which can resolve the LHCb anomalies related with B→K(∗)ℓ+ℓ−. Therefore both DM and B physics anomalies could be accommodated in the model.