  We derive the UV-optical stellar dust attenuation curve of galaxies at
z=1.4-2.6 as a function of gas-phase metallicity. We use a sample of 218
star-forming galaxies, excluding those with very young or heavily obscured star
formation, from the MOSFIRE Deep Evolution Field (MOSDEF) survey with
H$\alpha$, H$\beta$, and [NII]$\lambda 6585$ spectroscopic measurements. We
constrain the shape of the attenuation curve by comparing the average flux
densities of galaxies sorted into bins of dust obscuration using Balmer
decrements, i.e., H$\alpha$-to-H$\beta$ luminosities. The average attenuation
curve for the high-metallicity sample (12+log(O/H)>8.5, corresponding to
$M_*\gtrsim10^{10.4}\,M_{\odot}$) has a shallow slope, identical to that of the
Calzetti local starburst curve, and a significant UV 2175A extinction bump that
is $\sim 0.5\times$ the strength of the Milky Way bump. On the other hand, the
average attenuation curve of the low-metallicity sample (12+log(O/H) $\sim
8.2-8.5$) has a steeper slope similar to that of the SMC curve, only consistent
with the Calzetti slope at the $3\sigma$ level. The UV bump is not detected in
the low-metallicity curve, indicating the relative lack of the small dust
grains causing the bump at low metallicities. Furthermore, we find that on
average the nebular reddening (E(B-V)) is a factor of 2 times larger than that
of the stellar continuum for galaxies with low metallicities, while the nebular
and stellar reddening are similar for galaxies with higher metallicities. The
latter is likely due to a high surface density of dusty clouds embedding the
star forming regions but also reddening the continuum in the high-metallicity
galaxies.
