Such a map whose fibers are smooth curves would yield a morphism from the base B to the moduli space of curves whose image is a proper smooth subvariety that misses the boundary parametrizing singular curves. In the other direction, a smooth complete subvariety of the moduli space which misses the boundary should give an example, by restricting the "universal family of curves on moduli" to that subvariety, provided we can finesse the fact that the universal family has problems over the locus of curves with automorphisms, i.e. essentially the singular locus of moduli, (actually the locus of curves with automorphisms may be larger, as in genus 2).
In genus 2 or more there is a Satake compactification of the moduli space of smooth curves having boundary of codimension at least 2 when g ≥ 3; and in genus 4 or more, the locus of curves with automorphisms also has codimension 2 or more. Thus at least in genus 4 or more, any general one dimensional linear section B of a projective embedding of the Satake compactification of moduli of curves, will give an example. Probably this can be made to work also in genus 3. (but not for g=2, because of Dan's observant comment below.)
Remark: The error in my original answer stemmed from my false claim that the boundary of the Satake compactification of M(g) had codimension at least 2, when g ≥ 2. This false statement appears in a few places in the literature (e.g. my original answer), but I should have known better. Indeed the boundary of the Satake compactification of A(g) seems to have codimension g, but the locus of Jacobians is not closed yet in A(g). The result of Mayer and Mumford was that the closure of the locus of Jacobians in A(g) adds in precisely the products of lower dimensional Jacobians. Thus when g=2, even before adding in the boundary of A(2), the closure of the 3 dimensional M(2) already includes the 2 dimensional locus of products of elliptic curves. A nice reference is Mumford's Michigan lectures on curves and their Jacobians.
Dan has explained codimensions of the boundary components in A(g) from the Satake compactification process more generally in his remarks below, and also how to resolve the singularities offered by the locus of curves with automorphisms. Thanks!