The ALHAMBRA survey: B-band luminosity function of quiescent and star-forming galaxies at 0.2 <= z < 1 by PDF analysis