Microscopic calculation of the optical properties and intrinsic losses in the methylammonium lead iodide perovskite system