Impact of magnetic field in three-dimensional flow of an Oldroyd-B nanofluid