We present a numerical model to simulate the growth and deformation of a viscoelastic biofilm in shear flow under different nutrient conditions. The mechanical interaction between the biofilm and the fluid is computed using the Immersed Boundary Method with viscoelastic parameters determined a priori from measurements reported in the literature. Biofilm growth occurs at the biofilm-fluid interface by a stochastic rule that depends on the local nutrient concentration. We compare the growth, migration, and morphology of viscoelastic biofilms with a common relaxation time of 18 minutes over the range of elastic moduli 10-1000 Pa in different nearby nutrient source configurations. Simulations with shear flow and an upstream or a downstream nutrient source indicate that soft biofilms grow more if nutrients are downstream and stiff biofilms grow more if nutrients are upstream. Also, soft biofilms migrate faster than stiff biofilms toward a downstream nutrient source, and although stiff biofilms migrate toward an upstream nutrient source, soft biofilms do not. Simulations without nutrients show that on the time scale of several hours, soft biofilms develop irregular structures at the biofilm-fluid interface, but stiff biofilms deform little. Our results agree with the biophysical principle that biofilms can adapt to their mechanical and chemical environment by modulating their viscoelastic properties. We also compare the behavior of a purely elastic biofilm to a viscoelastic biofilm with the same elastic modulus of 50 Pa. We find the elastic biofilm underestimates growth rates and downstream migration rates if the nutrient source is downstream, and it overestimates growth rates and upstream migration rates if the nutrient source is upstream. Future modeling can use our comparison to identify errors that can occur by simulating biofilms as purely elastic structures.