This paper investigates the interplay between monetary aggregates and the dynamics and variability of output and prices by considering both the money supplied by commercial banks as credit to firms and the fiat money created by the central bank through the quantitative easing monetary policy. The authors address this problem by means of an agent-based model and simulator, called Eurace, which is characterized by a complete set of interrelated markets and different types of interacting agents, modeled according to a rigorous balance-sheet approach. The dynamics of credit money is endogenous and depends on the supply of credit from the banking system, which is constrained by its equity base, and the demand of credit from firms in order to finance their production activity. Alternative dynamic paths for credit money have been produced by setting different firms' dividend policies. Results point out the strict dependence of output and prices dynamics on monetary aggregates, and show the emergence of endogenous business cycles which are mainly due to the interplay between the real economic activity and its financing through the credit market. In particular, the amplitude of the business cycles strongly rises when the fraction of earnings paid out by firms as dividends is higher, that is when firms are more constrained to borrow credit money to fund their activity. This interesting evidence can be explained by the fact that the level of firms leverage, defined as the debt-equity ratio, can be considered ad a proxy of the likelihood of bankruptcy, an event which causes mass layoffs and supply decrease.