Strings and D-branes in a supersymmetric magnetic flux background