Magnetic phases of the frustrated spin dimer compound Ba3Mn2O8