Laser cooling of optically trapped molecules