One who relieves himself, washes his hands, puts on tefillin, recites the Shema and prays is as though he built an altar and brought an offering on it, and as though he had immersed.
Sefer HaMidos, Prayer, Part I §40