A particle-in-cell method for the simulation of plasmas based on an unconditionally stable wave equation solver