Price formation in an artificial market: limit order book versus matching of supply and demand