Using a two-dimensional electromagnetic and relativistic particle-in-cell (PIC) code, we show that high-frequency electromagnetic waves can be emitted by the plasma maser from Langmuir waves generated by cold electron beam instability in pair plasmas. It is confirmed that the presence of a magnetic field is essential for the plasma maser mechanism.